/*
Copyright 2008, 2009 Joonas Lehtolahti

This file is part of Shared Datatypes and Utilities.

Shared Datatypes and Utilities is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Shared Datatypes and Utilities is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Shared Datatypes and Utilities.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _PRQUEUE_H_
#define _PRQUEUE_H_

#include "shared_def.h"
#include "linkedlist.h"

typedef struct _pqueue {
	LinkedList *q;
	CMPFUNC    *cmpfunc;
} PQueue;

DLLEXPORT(PQueue*) newPQueue(CMPFUNC *cmpfunc);
DLLEXPORT(ListNode*) PQueueInsert(PQueue* q, void *data);
DLLEXPORT(void *) PQueuePeek(PQueue *q);
DLLEXPORT(void *) PQueuePoll(PQueue *q);
DLLEXPORT(void *) PQueueCancel(PQueue *q, void *data);
DLLEXPORT(void *) PQueueFind(PQueue *q, void *data);

#endif
